﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/admin.master" AutoEventWireup="true" CodeFile="ChiTietVacxin.aspx.cs" Inherits="Admin_ChiTietVacxin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <script src="../Scripts/jquery-ui-1.8.16.custom.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#<%=txtNgayNhap.ClientID%>").datepicker({ dateFormat: "dd/mm/yy", maxDate: "+0D" });
            $("#<%=txtNgaySanXuat.ClientID%>").datepicker({ dateFormat: "dd/mm/yy", maxDate: "+0D" });
            $("#<%=txtHanSuDung.ClientID%>").datepicker({ dateFormat: "dd/mm/yy", maxDate: "" });
            activeMenu(2, 0);
        });
    </script>
    <div class="divsize">
        <asp:HiddenField ID="VacXinID" runat="server" />
         <fieldset>
            <legend>Chi tiết Vac-xin</legend>
            <asp:Label ID="messageKetQua" runat="server" Text=""></asp:Label>
            <ol class="form form-clear">
                    <li>
                        <label>Mã CT Vacxin</label>
                        <asp:TextBox ID="txtCTMaVC" Enabled="false" runat="server"></asp:TextBox>
                    </li>
                    <li>
                        <label>Mã Vacxin</label>
                        <asp:DropDownList ID="cbMaVC" runat="server" Width="210px" ></asp:DropDownList>
                    </li>
                    <li>
                        <label>Số lượng</label>
                        <asp:TextBox ID="txtSoLuong" runat="server"></asp:TextBox>
                    </li>
                    <li>
                        <label>Ngày sản xuất</label>
                        <asp:TextBox ID="txtNgaySanXuat" runat="server"></asp:TextBox>
                    </li>
                    <li>
                        <label>Ngày nhập</label>
                        <asp:TextBox ID="txtNgayNhap" runat="server"></asp:TextBox>
                    </li>
                    <li>
                        <label>Hạn sử dụng</label>
                        <asp:TextBox ID="txtHanSuDung" runat="server"></asp:TextBox>
                    </li>

                <li>                    
                    <asp:Button ID="btnThem" runat="server" CssClass="btn primary" Text="Thêm mới" Visible="true" OnClick="btnThem_Click"/>
                    <asp:Button ID="btnCapNhatSua" runat="server" CssClass="btn primary" Text="Cập nhật sửa" Visible="false" OnClick="btnCapNhatSua_Click" />
                </li>
            </ol>
        </fieldset>
    </div>
    <div>
        <fieldset>
            <asp:ListView ID="ListViewCTVacxin" runat="server" 
                            OnItemCommand="ListViewCTVacxin_OnItemCommand"
                            OnItemDeleting="ListViewCTVacxin_OnItemDeleting"
                            OnItemUpdating="ListViewCTVacxin_OnItemUpdating">
                <LayoutTemplate>
                    <table border="1">
                        <tr>
                            <th>Ma chi tiet vacxin</th>
                            <th>Mã Vacxin</th>
                            <th>Số lượng</th>
                            <th>Ngày Sản Xuất</th>
                            <th>Ngày Nhập</th>
                            <th>Hạn Sử Dụng</th>
                            <th>Thao tác</th>
                        </tr>
                        <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
                    </table>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr>
                        <td><%# Eval("MaCTVC") %></td>
                        <td><%# Eval("MaVC") %></td>
                        <td><%# Eval("SoLuong") %></td>
                        <td><%# Eval("NgaySX") %></td>
                        <td><%# Eval("Ngaynhap") %></td>
                        <td><%# Eval("HanSD") %></td>
                        <td>
                            <asp:LinkButton ID="LinkButtonSua" ToolTip="Sửa thông tin" runat="server" 
                                            CommandArgument='<%#Eval("MaCTVC") %>' CommandName="Update">Sửa</asp:LinkButton>
                            |
                            <asp:LinkButton ID="LinkButtonXoa" ToolTip="Xóa bản ghi này" runat="server" 
                                            CommandArgument='<%#Eval("MaCTVC") %>' CommandName="Delete" 
                                            ForeColor="Brown" OnClientClick="return confirm('Bạn chắc chắn muốn xóa?')">Xóa</asp:LinkButton>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:ListView>
            <asp:Label ID="lableNull" runat="server" Enabled="false" Text="Không có chi tết vac-xin nào được tìm thấy."></asp:Label>
        </fieldset>
    </div>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <ul class="m-melanin-vertical-navigation">
         <li>
                <span class=" ss_sprite ss_shield">&nbsp;</span>
                <a id="A4" href="Vacxin.aspx" class="m-melanin-vertical-navigation-link">Vac-xin</a>
          </li>
    </ul>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder3" runat="Server">
    <asp:Button ID="button_create_ctvacxin" runat="server" CssClass="btn small primary" Text="Thêm chi tiết vacxin" />
</asp:Content>
